package com.example.test;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Arrays;
import java.util.List;

@Configuration
public class lnterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        List<String> excludpath = Arrays.asList("/login","/loginAction","/logout","/index","/loginIn","/add","/addUser");

        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**").excludePathPatterns(excludpath);
    }
}

